#ifndef CTCPSVRPROC_H
#define CTCPSVRPROC_H

#include <QtNetwork>
#include <QMessageBox>
#include <QObject>
#include <QDebug>

//#include "forwardsvr.h"

class CTcpSvrProc : public  QObject
{
    Q_OBJECT

public:
    CTcpSvrProc();
    ~CTcpSvrProc();

    void connectSvr(QString sIp, QString sPort);
    void disconnectSvr();
    void sendData(QByteArray &qbData);
    void sendData(const char *pData, int iDataLen);
    void disErrMsg(QString str);

public slots:
    void onConnected();
    void onDataRecv();
    void slotDisconnected();

signals:
    void onHasData(QByteArray &datagram);
    void onErrorMsg(QString &str);
    void onDisconnect();

private:

    int port;    
    QHostAddress *serverIP;
    QTcpSocket *tcpSocket;
    bool bConnectFlag;
};

#endif // CTCPSVRPROC_H
